<?php
abstract class TimeProfiles extends CActiveRecord
{
	protected function beforeValidate()
    {   		
		if($this->isNewRecord)
		{
            $this->updated_on=new CDbExpression('NOW()');
            $this->user_id=Yii::app()->user->id;
        }
		else
		{   
	       	$this->updated_on=new CDbExpression('NOW()');
		}		
		return parent::beforeValidate();

	}
	
}
